3.35 \(\int \frac{\cos ^6(x)}{a+b \cos ^2(x)} \, dx\)

Optimal. Leaf size=87 \[ \frac{x \left (8 a^2-4 a b+3 b^2\right )}{8 b^3}+\frac{a^{5/2} \tan ^{-1}\left (\frac{\sqrt{a+b} \cot (x)}{\sqrt{a}}\right )}{b^3 \sqrt{a+b}}-\frac{(4 a-3 b) \sin (x) \cos (x)}{8 b^2}+\frac{\sin (x) \cos ^3(x)}{4 b} \]

[Out]

((8*a^2 - 4*a*b + 3*b^2)*x)/(8*b^3) + (a^(5/2)*ArcTan[(Sqrt[a + b]*Cot[x])/Sqrt[a]])/(b^3*Sqrt[a + b]) - ((4*a
 - 3*b)*Cos[x]*Sin[x])/(8*b^2) + (Cos[x]^3*Sin[x])/(4*b)

________________________________________________________________________________________

Rubi [A]  time = 0.196291, antiderivative size = 87, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.4, Rules used = {3187, 470, 578, 522, 203, 205} \[ \frac{x \left (8 a^2-4 a b+3 b^2\right )}{8 b^3}+\frac{a^{5/2} \tan ^{-1}\left (\frac{\sqrt{a+b} \cot (x)}{\sqrt{a}}\right )}{b^3 \sqrt{a+b}}-\frac{(4 a-3 b) \sin (x) \cos (x)}{8 b^2}+\frac{\sin (x) \cos ^3(x)}{4 b} \]

Antiderivative was successfully verified.

[In]

Int[Cos[x]^6/(a + b*Cos[x]^2),x]

[Out]

((8*a^2 - 4*a*b + 3*b^2)*x)/(8*b^3) + (a^(5/2)*ArcTan[(Sqrt[a + b]*Cot[x])/Sqrt[a]])/(b^3*Sqrt[a + b]) - ((4*a
 - 3*b)*Cos[x]*Sin[x])/(8*b^2) + (Cos[x]^3*Sin[x])/(4*b)

Rule 3187

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = FreeF
actors[Tan[e + f*x], x]}, Dist[ff^(m + 1)/f, Subst[Int[(x^m*(a + (a + b)*ff^2*x^2)^p)/(1 + ff^2*x^2)^(m/2 + p
+ 1), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]

Rule 470

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> -Simp[(a*e^(2
*n - 1)*(e*x)^(m - 2*n + 1)*(a + b*x^n)^(p + 1)*(c + d*x^n)^(q + 1))/(b*n*(b*c - a*d)*(p + 1)), x] + Dist[e^(2
*n)/(b*n*(b*c - a*d)*(p + 1)), Int[(e*x)^(m - 2*n)*(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[a*c*(m - 2*n + 1) +
(a*d*(m - n + n*q + 1) + b*c*n*(p + 1))*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[b*c - a*d, 0] &
& IGtQ[n, 0] && LtQ[p, -1] && GtQ[m - n + 1, n] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 578

Int[((g_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_)*((e_) + (f_.)*(x_)^(n_)), x
_Symbol] :> Simp[(g^(n - 1)*(b*e - a*f)*(g*x)^(m - n + 1)*(a + b*x^n)^(p + 1)*(c + d*x^n)^(q + 1))/(b*n*(b*c -
 a*d)*(p + 1)), x] - Dist[g^n/(b*n*(b*c - a*d)*(p + 1)), Int[(g*x)^(m - n)*(a + b*x^n)^(p + 1)*(c + d*x^n)^q*S
imp[c*(b*e - a*f)*(m - n + 1) + (d*(b*e - a*f)*(m + n*q + 1) - b*n*(c*f - d*e)*(p + 1))*x^n, x], x], x] /; Fre
eQ[{a, b, c, d, e, f, g, q}, x] && IGtQ[n, 0] && LtQ[p, -1] && GtQ[m - n + 1, 0]

Rule 522

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\cos ^6(x)}{a+b \cos ^2(x)} \, dx &=-\operatorname{Subst}\left (\int \frac{x^6}{\left (1+x^2\right )^3 \left (a+(a+b) x^2\right )} \, dx,x,\cot (x)\right )\\ &=\frac{\cos ^3(x) \sin (x)}{4 b}-\frac{\operatorname{Subst}\left (\int \frac{x^2 \left (3 a+(-a+3 b) x^2\right )}{\left (1+x^2\right )^2 \left (a+(a+b) x^2\right )} \, dx,x,\cot (x)\right )}{4 b}\\ &=-\frac{(4 a-3 b) \cos (x) \sin (x)}{8 b^2}+\frac{\cos ^3(x) \sin (x)}{4 b}+\frac{\operatorname{Subst}\left (\int \frac{a (4 a-3 b)+\left (-4 a^2+a b-3 b^2\right ) x^2}{\left (1+x^2\right ) \left (a+(a+b) x^2\right )} \, dx,x,\cot (x)\right )}{8 b^2}\\ &=-\frac{(4 a-3 b) \cos (x) \sin (x)}{8 b^2}+\frac{\cos ^3(x) \sin (x)}{4 b}+\frac{a^3 \operatorname{Subst}\left (\int \frac{1}{a+(a+b) x^2} \, dx,x,\cot (x)\right )}{b^3}-\frac{\left (8 a^2-4 a b+3 b^2\right ) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\cot (x)\right )}{8 b^3}\\ &=\frac{\left (8 a^2-4 a b+3 b^2\right ) x}{8 b^3}+\frac{a^{5/2} \tan ^{-1}\left (\frac{\sqrt{a+b} \cot (x)}{\sqrt{a}}\right )}{b^3 \sqrt{a+b}}-\frac{(4 a-3 b) \cos (x) \sin (x)}{8 b^2}+\frac{\cos ^3(x) \sin (x)}{4 b}\\ \end{align*}

Mathematica [A]  time = 0.212795, size = 76, normalized size = 0.87 \[ \frac{4 x \left (8 a^2-4 a b+3 b^2\right )-\frac{32 a^{5/2} \tan ^{-1}\left (\frac{\sqrt{a} \tan (x)}{\sqrt{a+b}}\right )}{\sqrt{a+b}}-8 b (a-b) \sin (2 x)+b^2 \sin (4 x)}{32 b^3} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]^6/(a + b*Cos[x]^2),x]

[Out]

(4*(8*a^2 - 4*a*b + 3*b^2)*x - (32*a^(5/2)*ArcTan[(Sqrt[a]*Tan[x])/Sqrt[a + b]])/Sqrt[a + b] - 8*(a - b)*b*Sin
[2*x] + b^2*Sin[4*x])/(32*b^3)

________________________________________________________________________________________

Maple [A]  time = 0.022, size = 122, normalized size = 1.4 \begin{align*} -{\frac{{a}^{3}}{{b}^{3}}\arctan \left ({a\tan \left ( x \right ){\frac{1}{\sqrt{ \left ( a+b \right ) a}}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) a}}}}-{\frac{ \left ( \tan \left ( x \right ) \right ) ^{3}a}{2\,{b}^{2} \left ( \left ( \tan \left ( x \right ) \right ) ^{2}+1 \right ) ^{2}}}+{\frac{3\, \left ( \tan \left ( x \right ) \right ) ^{3}}{8\,b \left ( \left ( \tan \left ( x \right ) \right ) ^{2}+1 \right ) ^{2}}}-{\frac{a\tan \left ( x \right ) }{2\,{b}^{2} \left ( \left ( \tan \left ( x \right ) \right ) ^{2}+1 \right ) ^{2}}}+{\frac{5\,\tan \left ( x \right ) }{8\,b \left ( \left ( \tan \left ( x \right ) \right ) ^{2}+1 \right ) ^{2}}}+{\frac{\arctan \left ( \tan \left ( x \right ) \right ){a}^{2}}{{b}^{3}}}-{\frac{\arctan \left ( \tan \left ( x \right ) \right ) a}{2\,{b}^{2}}}+{\frac{3\,\arctan \left ( \tan \left ( x \right ) \right ) }{8\,b}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)^6/(a+b*cos(x)^2),x)

[Out]

-1/b^3/((a+b)*a)^(1/2)*arctan(a*tan(x)/((a+b)*a)^(1/2))*a^3-1/2/b^2/(tan(x)^2+1)^2*tan(x)^3*a+3/8/b/(tan(x)^2+
1)^2*tan(x)^3-1/2/b^2/(tan(x)^2+1)^2*tan(x)*a+5/8/b/(tan(x)^2+1)^2*tan(x)+1/b^3*arctan(tan(x))*a^2-1/2/b^2*arc
tan(tan(x))*a+3/8/b*arctan(tan(x))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^6/(a+b*cos(x)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.94392, size = 666, normalized size = 7.66 \begin{align*} \left [\frac{2 \, a^{2} \sqrt{-\frac{a}{a + b}} \log \left (\frac{{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \,{\left (4 \, a^{2} + 3 \, a b\right )} \cos \left (x\right )^{2} + 4 \,{\left ({\left (2 \, a^{2} + 3 \, a b + b^{2}\right )} \cos \left (x\right )^{3} -{\left (a^{2} + a b\right )} \cos \left (x\right )\right )} \sqrt{-\frac{a}{a + b}} \sin \left (x\right ) + a^{2}}{b^{2} \cos \left (x\right )^{4} + 2 \, a b \cos \left (x\right )^{2} + a^{2}}\right ) +{\left (8 \, a^{2} - 4 \, a b + 3 \, b^{2}\right )} x +{\left (2 \, b^{2} \cos \left (x\right )^{3} -{\left (4 \, a b - 3 \, b^{2}\right )} \cos \left (x\right )\right )} \sin \left (x\right )}{8 \, b^{3}}, \frac{4 \, a^{2} \sqrt{\frac{a}{a + b}} \arctan \left (\frac{{\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a\right )} \sqrt{\frac{a}{a + b}}}{2 \, a \cos \left (x\right ) \sin \left (x\right )}\right ) +{\left (8 \, a^{2} - 4 \, a b + 3 \, b^{2}\right )} x +{\left (2 \, b^{2} \cos \left (x\right )^{3} -{\left (4 \, a b - 3 \, b^{2}\right )} \cos \left (x\right )\right )} \sin \left (x\right )}{8 \, b^{3}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^6/(a+b*cos(x)^2),x, algorithm="fricas")

[Out]

[1/8*(2*a^2*sqrt(-a/(a + b))*log(((8*a^2 + 8*a*b + b^2)*cos(x)^4 - 2*(4*a^2 + 3*a*b)*cos(x)^2 + 4*((2*a^2 + 3*
a*b + b^2)*cos(x)^3 - (a^2 + a*b)*cos(x))*sqrt(-a/(a + b))*sin(x) + a^2)/(b^2*cos(x)^4 + 2*a*b*cos(x)^2 + a^2)
) + (8*a^2 - 4*a*b + 3*b^2)*x + (2*b^2*cos(x)^3 - (4*a*b - 3*b^2)*cos(x))*sin(x))/b^3, 1/8*(4*a^2*sqrt(a/(a +
b))*arctan(1/2*((2*a + b)*cos(x)^2 - a)*sqrt(a/(a + b))/(a*cos(x)*sin(x))) + (8*a^2 - 4*a*b + 3*b^2)*x + (2*b^
2*cos(x)^3 - (4*a*b - 3*b^2)*cos(x))*sin(x))/b^3]

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)**6/(a+b*cos(x)**2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.16225, size = 140, normalized size = 1.61 \begin{align*} -\frac{{\left (\pi \left \lfloor \frac{x}{\pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (a\right ) + \arctan \left (\frac{a \tan \left (x\right )}{\sqrt{a^{2} + a b}}\right )\right )} a^{3}}{\sqrt{a^{2} + a b} b^{3}} + \frac{{\left (8 \, a^{2} - 4 \, a b + 3 \, b^{2}\right )} x}{8 \, b^{3}} - \frac{4 \, a \tan \left (x\right )^{3} - 3 \, b \tan \left (x\right )^{3} + 4 \, a \tan \left (x\right ) - 5 \, b \tan \left (x\right )}{8 \,{\left (\tan \left (x\right )^{2} + 1\right )}^{2} b^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^6/(a+b*cos(x)^2),x, algorithm="giac")

[Out]

-(pi*floor(x/pi + 1/2)*sgn(a) + arctan(a*tan(x)/sqrt(a^2 + a*b)))*a^3/(sqrt(a^2 + a*b)*b^3) + 1/8*(8*a^2 - 4*a
*b + 3*b^2)*x/b^3 - 1/8*(4*a*tan(x)^3 - 3*b*tan(x)^3 + 4*a*tan(x) - 5*b*tan(x))/((tan(x)^2 + 1)^2*b^2)